/*
 * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OT_SCENE_DETECTION_H
#define OT_SCENE_DETECTION_H

#include "ot_af_common.h"

typedef struct {
    td_bool isSceneChanged;             /* Indicates whether a scene is changed. */
    td_bool isLowLight;                 /* Indicates whether a Low light scene is detected. */
    td_bool isFlatSceneDetected;        /* Indicates whether a flat scene is detected. */
    td_bool isHorizontalLineDetected;   /* Indicates whether a horizontal line is detected */
} OT_AF_SceneDetection;

typedef struct {
    td_s64 timestamp;
    OT_AF_SceneDetection flexible[MAX_FLEXIBLE_WINDOW_NUM];
    OT_AF_SceneDetection fixed[MAX_FIXED_WINDOW_HEIGHT_NUM][MAX_FIXED_WINDOW_WIDTH_NUM];
} OT_AF_SceneDetectionResult;

typedef struct {
    td_s32 (*init)(td_void **handle, const OT_AF_InitParam *initParam);
    td_s32 (*deinit)(td_void *handle);
    td_s32 (*sceneDetect)(td_void *handle, const OT_AF_WindowConfig *winConfig, OT_AF_SceneDetectionResult *result);
} OT_AF_SceneDetectionIntf;

OT_AF_SceneDetectionIntf *AF_SCENE_DETECTION_GetAlg(td_void);

#endif
